package com.wjk.kylin.id.server.exception;

import com.wjk.kylin.id.server.constant.Constants;
import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class BaseError {

    private int code;
    private String msg;

    /**
     * 默认错误码的构造
     */
    public BaseError(String msg) {
        this.code = Constants.ERROR;
        this.msg = msg;
    }

    /**
     * 成功
     */
    public static final BaseError SUCCESS = new BaseError(Constants.SUCCESS, "操作成功");
    /**
     * 权限异常
     */
    public static final BaseError LOGIN_ERR = new BaseError(402, "登录失败");

    /**
     * 参数异常
     */
    public static final BaseError PARAM_ERR = new BaseError(600, "参数异常");
    public static final BaseError TOKEN_PARAM_ERR = new BaseError(601, "token参数异常");
    public static final BaseError BIZ_TYPE_PARAM_ERR = new BaseError(602, "biz_type参数异常");
    public static final BaseError TOKEN_BIZ_TYPE_PARAM_ERR = new BaseError(603, "token or biz_type参数异常");

    /**
     * 系统异常
     */
    public static final BaseError SYS_ERR = new BaseError(10000, "服务器异常");

    /**限流降级熔断 */

    /**三方异常*/


}
